/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "docentexperiodo")
@NamedQueries({
    @NamedQuery(name = "Docentexperiodo.findAll", query = "SELECT d FROM Docentexperiodo d"),
    @NamedQuery(name = "Docentexperiodo.findByNDcnId", query = "SELECT d FROM Docentexperiodo d WHERE d.docentexperiodoPK.nDcnId = :nDcnId"),
    @NamedQuery(name = "Docentexperiodo.findByNPrdId", query = "SELECT d FROM Docentexperiodo d WHERE d.docentexperiodoPK.nPrdId = :nPrdId"),
    @NamedQuery(name = "Docentexperiodo.findByVEstado", query = "SELECT d FROM Docentexperiodo d WHERE d.vEstado = :vEstado")})
public class Docentexperiodo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DocentexperiodoPK docentexperiodoPK;
    @Column(name = "vEstado")
    private String vEstado;
    @JoinColumn(name = "nPrdId", referencedColumnName = "nPrdId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Periodo periodo;
    @JoinColumn(name = "nDcnId", referencedColumnName = "nDcnId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Docente docente;

    public Docentexperiodo() {
    }

    public Docentexperiodo(DocentexperiodoPK docentexperiodoPK) {
        this.docentexperiodoPK = docentexperiodoPK;
    }

    public Docentexperiodo(int nDcnId, int nPrdId) {
        this.docentexperiodoPK = new DocentexperiodoPK(nDcnId, nPrdId);
    }

    public DocentexperiodoPK getDocentexperiodoPK() {
        return docentexperiodoPK;
    }

    public void setDocentexperiodoPK(DocentexperiodoPK docentexperiodoPK) {
        this.docentexperiodoPK = docentexperiodoPK;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public Periodo getPeriodo() {
        return periodo;
    }

    public void setPeriodo(Periodo periodo) {
        this.periodo = periodo;
    }

    public Docente getDocente() {
        return docente;
    }

    public void setDocente(Docente docente) {
        this.docente = docente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (docentexperiodoPK != null ? docentexperiodoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Docentexperiodo)) {
            return false;
        }
        Docentexperiodo other = (Docentexperiodo) object;
        if ((this.docentexperiodoPK == null && other.docentexperiodoPK != null) || (this.docentexperiodoPK != null && !this.docentexperiodoPK.equals(other.docentexperiodoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Docentexperiodo[ docentexperiodoPK=" + docentexperiodoPK + " ]";
    }
    
}
